<template>
  <basic-container class="noScrollBar tabMain-wrap">
    <common-template
        ref="detailRef"
        :detailOptions="detailOptions"
        :flowModelId="flowModelId"
        :flowStatus="flowStatus"
        :submitUrl="submitUrl"
        :returnUrl="returnUrl"
        :filePrint="filePrint"
    ></common-template>
  </basic-container>
</template>
<script>
import commonTemplate from "../commonTemplate";
import {getToken} from '@/util/auth';
import flowLogList from "../flowList";
import uploadReport from "@/api/flow/flow";
import {
    xnyFlowModelId,
    xnySubmit,
    xnyReturnSubmit,
    getXnybwxnList,
    xnybwxnRemove,
    xnybwxnUpdate,
    xnybwxnSave,
    xnyPrint,
} from "@/api/sxdky/sxdky";
export default {
  data() {
    return {
      // 流程模型
      flowModelId:xnyFlowModelId,
      // 提交URL
      submitUrl:xnySubmit,
      // 驳回URL
      returnUrl:xnyReturnSubmit,
      // 打印报告
      filePrint:xnyPrint,
      // 流程状态
      flowStatus:true,
      detailOptions: {
        label: "新能源并网性能管理",
        name: "testReportList",
        options: {
          height: "calc(100vh - 425px)",
          addBtn: true,
          menuDelBtn: false,
          menuUpBtn: false,
          menuDownBtn: true,
          dialogDirection: "ltr",
          dialogType: "drawer",
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          menuForm: false,
          indexLabel: "序号",
          viewBtn: false,
          selection: true,
          excelBtn: false,
          dialogClickModal: false,
          menuOtherBtn: true,
          gistBtn: false,
          align: "center",
          menuAlign: "center",
          searchIcon: true,
          searchIndex: 3,
          labelWidth: 120,
          editBtn: false,
          delBtn: false,
          column: [
            {
                label: "检测报告",
                prop: 'reportUploadName',
                type: "upload",
                showFileList: true,
                loadText: "模板上传中，请稍等",
                span: 24,
                propsHttp: {
                    res: "data.data.object",
                },
                slot:true,
                accept: ".docx,.doc,",
                tip: "请上传 .doc,.docx 标准格式文件",
                action: '/api/dis-report/xnybwxn/upload',
            },
            {
                label: "检测报告",
                prop: "reportUploadName",
                editDisplay: false,
                hide:true,
                viewDisplay: false,
                overHidden: true,
                search: false,
                addDisplay:false,
                rules: [
                    {
                        message: "请输入报告名称",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "付款凭证",
                prop: 'payProof',
                type: "upload",
                listType:'picture-card',
                multiple:true,
                limit: 5,
                showFileList: true,
                loadText: "模板上传中，请稍等",
                span: 24,
                propsHttp: {
                    res:"data.data"
                },
                slot:true,
                accept: ".png,.jpeg",
                tip: "请上传 .png,.jpeg,标准格式文件",
                action: '/api/dis-report/xnybwxn/payProofUpload',
            },

            {
                label: "付款凭证",
                prop: "payProof",
                editDisplay: false,
                hide:true,
                viewDisplay: false,
                overHidden: true,
                search: false,
                addDisplay:false,
            },
            {
                label: "报告编号",
                prop: "reportNum",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
            },
            {
                label: "报告名称",
                prop: "reportName",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
                span:24,
                rules: [
                    {
                        required: true,
                        message: "请输入报告名称",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "项目编号",
                prop: "projectNum",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
                rules: [
                    {
                        required: true,
                        message: "请输入项目编号",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "项目负责人",
                prop: "manager",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
            },
            {
                label: "试验地点",
                prop: "checkSite",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
                rules: [
                    {
                        required: true,
                        message: "请输入试验地点",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "试验人员",
                prop: "testMan",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
                rules: [
                    {
                        required: true,
                        message: "请输入试验人员",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "试验单位",
                prop: "testDept",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
                rules: [
                    {
                        required: true,
                        message: "请输入试验单位",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "试验日期",
                prop: "testDate",
                sortable: true,
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
            },
            {
                label: "报告日期",
                prop: "reportDate",
                type: "date",
                sortable: true,
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                format: "yyyy-MM-dd",
                valueFormat: "yyyy-MM-dd",
            },
            {
                label: "监督人员",
                prop: "superviseMan",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
                rules: [
                    {
                        required: true,
                        message: "请输入监督人员",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "监督单位",
                prop: "superviseDept",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: false,
                span:24,
                rules: [
                    {
                        required: true,
                        message: "请输入监督单位",
                        trigger: "click",
                    },
                ],
            },
            {
                label: "报告打印",
                prop: "printMan",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
            },
            {
                label: "校阅",
                prop: "reviewer",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                search: true,
            },

            {
                label: "报告页数",
                prop: "page",
                type: "number",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                sortable: true,
                controlsPosition: "top",
            },
            {
                label: "出版份数",
                prop: "pubCount",
                type: "select",
                editDisplay: true,
                viewDisplay: true,
                overHidden: true,
                sortable: true,
                rules: [
                    {
                        required: true,
                        message: "请输入出版份数",
                        trigger: "click",
                    },
                ],
                dicData: [
                    {
                        label: "电科院2份",
                        value: 2,
                    },
                    {
                        label: "世纪10份",
                        value: 10,
                    }
                ],
            },
            {
                label: "提交人",
                prop: "submitName",
                search: true,
                addDisplay:false,
                editDisplay: false,
                viewDisplay: false,
                overHidden: true,
            },
            {
                label: "审批人",
                prop: "flowOperator",
                search: true,
                addDisplay:false,
                editDisplay: false,
                viewDisplay: true,
                overHidden: true,
            },
            {
                label: "处理状态",
                prop: "submitStatus",
                addDisplay:false,
                hide:true,
                editDisplay: false,
                viewDisplay: false,
                overHidden: true,
            },
            {
                label: "处理状态",
                prop: "submitStatus",
                type: "select",
                search: true,
                addDisplay:false,
                editDisplay: false,
                viewDisplay: false,
                dicData: [
                    {
                        label: "新建",
                        value: 0,
                    },
                    {
                        label: "审核中",
                        value: 1,
                    },
                    {
                        label: "已审核",
                        value: 2,
                    },
                    {
                        label: "已退件",
                        value: 3,
                    },
                ],
            },
          ],
        },
        url: {
          getList: getXnybwxnList,
          remove: xnybwxnRemove,
          update: xnybwxnUpdate,
          add: xnybwxnSave,
        },
      },
    };
  },
  components: {
      uploadReport,
      flowLogList,
      commonTemplate,
  },
  computed: {},
  methods: {
  },
};
</script>

<style lang='scss'>
.tabMain-wrap {
  // height: calc(100vh - 400px);
  overflow: hidden auto;
}
</style>
